﻿

@{
    ViewBag.Title = "订票";
}


<h4>订票</h4>
<hr />
@using (Html.BeginForm("BookList", "Airline", FormMethod.Get)) 
{ 
    <table class="table">
    <tr>
        <th>
            起始地
            @Html.DropDownList("EscapeDistrict", new List<SelectListItem>() {
             new SelectListItem()
             {Text = "广州",
               Value = "广州"
             },
             new SelectListItem()
             {Text = "上海",
               Value = "上海"
             },
             new SelectListItem()
             {Text = "北京",
               Value = "北京"
             },
             new SelectListItem()
             {Text = "西安",
               Value = "西安"
             },
             new SelectListItem()
             {Text = "武汉",
               Value = "武汉"
             },
             new SelectListItem()
             {Text = "三亚",
               Value = "三亚"
             }
         }, "---请选择---")
        </th>
        <th>
              终点地
              @Html.DropDownList("ArriveDistrict", new List<SelectListItem>() {
             new SelectListItem()
             {Text = "广州",
               Value = "广州"
             },
             new SelectListItem()
             {Text = "上海",
               Value = "上海"
             },
             new SelectListItem()
             {Text = "北京",
               Value = "北京"
             },
             new SelectListItem()
             {Text = "西安",
               Value = "西安"
             },
             new SelectListItem()
             {Text = "武汉",
               Value = "武汉"
             },
             new SelectListItem()
             {Text = "三亚",
               Value = "三亚"
             }
         }, "---请选择---")
        </th>
        <th>
            开始时间
            <input type="date" id="fromDate" name="fromDate" />
        </th>
        <th>
            终止时间
            <input type="date" id="toDate" name="toDate" />
        </th>
        <td><input type="submit" value="查询" /></td>
    </tr>
    </table>
}

@section Scripts {
    <script type="text/javascript">
        (function (selector) {
            var date = new Date();
            document.querySelector(selector).value = date.getFullYear() + "-" + (date.getMonth() >= 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1)) + "-" + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate());
        })('#fromDate');
        (function (selector) {
            var date = new Date();
            document.querySelector(selector).value = date.getFullYear() + "-" + (date.getMonth() >= 9 ? date.getMonth() + 1 : '0' + (date.getMonth() + 1)) + "-" + (date.getDate() >= 10 ? date.getDate() : '0' + date.getDate());
        })('#toDate');
</script>
}



